package com.cy;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Luckyh
 * @date : 2021/4/8 11:59
 */
@SpringBootApplication
public class NacosProviderApplication {
    public static void main(String[] args) {
        SpringApplication.run(NacosProviderApplication.class, args);
    }

    @Value("${server.port}") // 告诉spring 从application.yml.取出指定属性对应的值
    private String server;

    @RestController
    public class ProviderController{
        @GetMapping("/provider/echo/{string}")
        public String doEcho(@PathVariable String string){
            return "Provider say:" +server+ string;
        }
    }
}
